package com.common.help.test14;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.common.util.DateUtils;

public class A {

	public static void main(String[] args) {
		
		String date = "20180814";
		String s = "0000";
		String e = "2400";
		String scheduleDate = date.substring(0, 4) + "-"
				+ date.substring(4, 6) + "-"
				+ date.substring(6, 8);
		String scheduleStartTime =s.substring(0, 2) + ":"
				+ s.substring(2, 4) + ":00";
		String scheduleStartEnd = e.substring(0, 2) + ":"
				+ e.substring(2, 4) + ":00";
		Date scheduleTimeEnd = DateUtils.strToDate(scheduleDate + " " + scheduleStartEnd);
		Date scheduleTimeStart = DateUtils.strToDate(scheduleDate + " " + scheduleStartTime);
		
		int i =11 ;
		if(i>=20){
			System.out.println("大于20");
		}else  if(i>=10){
			System.out.println("大于10");
		}else  if(i>=1){
			System.out.println("大于1");
		}	
			
			
			Calendar cal = Calendar.getInstance();
			int day = cal.get(Calendar.DATE);
			String date1 = DateUtils.getYearMonth(cal.getTime());
			String start = date1 + "-01" +" 00:00:00";
			String end = date1 + "-"+day+" 23:59:59";
			System.out.println(start+"=====>"+end);
			
			Calendar calendar = Calendar.getInstance();
			//calendar.add(Calendar.MONTH, -1);
			int a = calendar.get(Calendar.MONTH)+1;
			System.out.println(a);
			
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
			String review = sdf.format(cal.getTime());
			
			System.out.println(review);
			String str = review.split("-")[1];
			int iii =Integer.valueOf(str);
			System.out.println(iii);
			
			int[] arrA = {1,2,3};

			int[] arrB = {4,5,6,7};
			arrA = arrB;
			System.out.println(arrA[0]);
			
			Point x = new Point(5,6);
			Point y = new Point(7,8);
			Line  l = new Line(x,y);
			System.out.println(l.distance());
	}
	
}
class Point{
	
	private int x;
	private int y;
	
	
	public Point() {
	}
	public Point(int x,int y) {
		this.x = x;
		this.y = y;
	}
	
	public double distance(Point p){
	    return Math.sqrt(Math.pow(x-p.getX(), 2)
	            +Math.pow(y-p.getY(), 2));
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
}
class Line{
	private Point start;
	private Point end;
	
	public Line(Point start ,Point end){
		this.start = start;
		this.end = end;
	}
	public double distance(){
		return start.distance(end);
	}
}